package com.ruoyi.web.controller.sqldow;

import com.ruoyi.sqldow.service.impl.BackUpServiceImpl;
import com.ruoyi.sqldow.service.impl.DeleteFileServiceImpl;
import com.ruoyi.sqldow.service.impl.SqlResponseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
/**
        * Author 许家森
        * Date 2022/3/5
        * Email 3448324670@qq.com
 */
@Controller
public class SqlBackeUpsController {
    @Autowired
    private BackUpServiceImpl backUpService;
    @Autowired
    private SqlResponseServiceImpl sqlbackups;
    @Autowired
    private DeleteFileServiceImpl deleteFileService;
    @RequestMapping("view/sql")
    public void sqlbackups(HttpServletResponse response) throws  Exception{
          String path=backUpService.BackUps();
          sqlbackups.SqlResponse(path,response);
          deleteFileService.DeleteFile(path);
    }

}
